package org.neowei.image.commond.Handle;

import org.neowei.image.api.ImageOption;
import org.neowei.image.commond.CmdOption;

public class BGResizeHandle extends AbstractHandle {

	@Override
	public void doHandle(ImageOption imageOption) throws Exception{
		int neowidth = super.imageOption.getNeowidth();
		int neoheight = super.imageOption.getNeoheight();
		CmdOption cmdOption = super.getCmdOption("convert");
		cmdOption.AddRow("-resize", super.getStrHeightWidth(neowidth, neoheight)).AddRow("-background", "white").AddRow("-gravity", "center")
				.AddRow("-extent", super.getStrHeightWidth(neowidth, neoheight));
		super.crop(cmdOption);
	}
}
